<?php

namespace App\Helpers;

use App\Services\LoggerService;

class LoggerHelper
{
    private static $loggers = [];

    public static function getLogger($channel = 'app', $logFile = 'app.log')
    {
        if (!isset(self::$loggers[$channel])) {
            self::$loggers[$channel] = new LoggerService($channel, $logFile);
        }
        return self::$loggers[$channel];
    }

    public static function channel($channel = 'app', $logFile = 'app.log')
    {
        return self::getLogger($channel, $logFile);
    }

    public static function emergency($message, array $context = [])
    {
        self::getLogger()->emergency($message, $context);
    }

    public static function alert($message, array $context = [])
    {
        self::getLogger()->alert($message, $context);
    }

    public static function critical($message, array $context = [])
    {
        self::getLogger()->critical($message, $context);
    }

    public static function error($message, array $context = [])
    {
        self::getLogger()->error($message, $context);
    }

    public static function warning($message, array $context = [])
    {
        self::getLogger()->warning($message, $context);
    }

    public static function notice($message, array $context = [])
    {
        self::getLogger()->notice($message, $context);
    }

    public static function info($message, array $context = [])
    {
        self::getLogger()->info($message, $context);
    }

    public static function debug($message, array $context = [])
    {
        self::getLogger()->debug($message, $context);
    }
}
